<template>
	<view class="yiyang-card-list">

		<view class="list">
			
			
			<view class="item" v-for="item in card_list" >
				<view class="card" >
					
					<view class="card-row name" v-if="item.card_type=='hehuoren'">
						<view class="key">会员卡：</view>
						<view class="value">合伙人</view>
					</view>
					<view class="card-row name" v-if="item.card_type=='xiaofeizhe'">
						<view class="key">会员卡：</view>
						<view class="value">消费者</view>
					</view>
					<view class="card-row amount">
						<view class="key">发放优惠券面额：</view>
						<view class="value">{{item.coupon_amount}}￥</view>
						
						
					</view>
					<view class="card-row number">
						<view class="key">
							发放优惠券数量：
						</view>
						<view class="value">
							{{item.coupon_number}}
						</view>
						
						
						
					</view>
					<view class="card-row time" >
						<view class="key">购卡时间：</view>
						<view class="value">
							{{item.created_at.split(' ')[0]}}
						</view>
						
						
						
					</view>				
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	const appInstance = getApp();
	export default{
		
		data() {
			
			return {
				card_list:[]
			}
		},
		
		onLoad(options) {
			
			this.init(options);
		},
		onPullDownRefresh() {
			this.init();
			setTimeout(function () {
			    uni.stopPullDownRefresh();
			}, 1000);
		},
		methods:{
			
			init:function( options ){
				this.get_card_list();
			},
			get_card_list:function(){
				var t = this;
				var url = '&r=yiyang_card.index';
				
				appInstance.globalData.request(url, {
					m: 'sm_shop_plugin_distribution'
				}, 'GET', function(res) {
					
					t.card_list = res.data;
					
				});
			}
		}
		
	}
</script>

<style lang="less">
	
	.yiyang-card-list{
		.list{
			.item{
				padding:20rpx;
				.card{
					
					border:solid 1px #cdcdcd;
					padding:20rpx;
					line-height: 1.5;
					.card-row{
						
						display:flex;
						justify-content: space-between;
						.key{
							
						}
						.value{
							
						}
					}
					.name{
						// font-size:36rpx;
						font-weight:bold;
					}
					.amount{
						
					}
					.number{
						
					}
					.time{
						
					}
				}
			}
		}
	}
</style>
